using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Guilds;
using Server.Commands;
using Server.Network;
using Server.Mobiles;
using Server.Accounting;
//namespace Server.Misc

namespace Server.Gumps
{
	public class SFTotalsGump : Gump
	{
		public SFTotalsGump( Mobile from ) : base( 200, 120 )
		{
			Mobile m_from = from;

                                                         // Attribute Caps
                			double BandageSpeedCap = 2.0;
                			int SwingSpeedCap = 100;

			string myname = m_from.Name;
			int myfame = m_from.Fame;
                			int mykarma = m_from.Karma;

                			int mystr = m_from.Str;
                			int mydex = m_from.Dex;
                			int myint = m_from.Int;
                			int mybonusstr = (AosAttributes.GetValue(m_from, AosAttribute.BonusStr));
                			int mybonusdex = (AosAttributes.GetValue(m_from, AosAttribute.BonusDex));
                			int mybonusint = (AosAttributes.GetValue(m_from, AosAttribute.BonusInt));

                			int myhits = m_from.HitsMax;
                			int mystam = m_from.StamMax;
                			int mymana = m_from.ManaMax;
                			int mybonushits = (AosAttributes.GetValue(m_from, AosAttribute.BonusHits));
                			int mybonusstam = (AosAttributes.GetValue(m_from, AosAttribute.BonusStam));
                			int mybonusmana = (AosAttributes.GetValue(m_from, AosAttribute.BonusMana));

                			int myhunger = m_from.Hunger;
                			int mythirst = m_from.Thirst;

                			int myattack = (AosAttributes.GetValue(m_from, AosAttribute.AttackChance));
               			int mycastrecovery = (AosAttributes.GetValue(m_from, AosAttribute.CastRecovery));
                			int mycastspeed = (AosAttributes.GetValue(m_from, AosAttribute.CastSpeed));
               			int mydefend = (AosAttributes.GetValue(m_from, AosAttribute.DefendChance));
               			int myenhancepotion = (AosAttributes.GetValue(m_from, AosAttribute.EnhancePotions));
              			int mylmc = (AosAttributes.GetValue(m_from, AosAttribute.LowerManaCost));
              			int mylrc = (AosAttributes.GetValue(m_from, AosAttribute.LowerRegCost));
             			int myluck = (AosAttributes.GetValue(m_from, AosAttribute.Luck));

                			int mysight = (AosAttributes.GetValue(m_from, AosAttribute.NightSight));
                			int myreflect = (AosAttributes.GetValue(m_from, AosAttribute.ReflectPhysical));
                			int myregenhit = (AosAttributes.GetValue(m_from, AosAttribute.RegenHits));
                			int myregenmana = (AosAttributes.GetValue(m_from, AosAttribute.RegenMana));
                			int myregenstam = (AosAttributes.GetValue(m_from, AosAttribute.RegenStam));
                			int myspelldamage = (AosAttributes.GetValue(m_from, AosAttribute.SpellDamage));
                                                        int DamageIncrease = (AosAttributes.GetValue( m_from, AosAttribute.WeaponDamage));
                			int myweaponspeed = (AosAttributes.GetValue(m_from, AosAttribute.WeaponSpeed));

                			double BandageSpeed = ( 2.0 + (0.5 * ((double)(205 - from.Dex) / 10)) ) < BandageSpeedCap ? BandageSpeedCap : ( 2.0 + (0.5 * ((double)(205 - from.Dex) / 10)) );
                                                        TimeSpan SwingSpeed = (from.Weapon as BaseWeapon).GetDelay(from) > TimeSpan.FromSeconds(SwingSpeedCap) ? TimeSpan.FromSeconds(SwingSpeedCap) : (from.Weapon as BaseWeapon).GetDelay(from);

			PlayerMobile pm_from = (PlayerMobile)from;
			int mytimemins = pm_from.GameTime.Minutes;
			int mytime = pm_from.GameTime.Hours;
			int mytimedays = pm_from.GameTime.Days;

			TimeSpan ctime=DateTime.Now - pm_from.SessionStart;
			string curr = ctime.Hours.ToString() + " : " + ctime.Minutes.ToString() + " : " + ctime.Seconds.ToString();

			this.Closable=true;
			this.Disposable=true;
			this.Dragable=true;
			this.Resizable=false;

			this.AddPage(0);
			this.AddBackground(0, 0, 460, 502, 9270);
			this.AddAlphaRegion( 11, 11, 189, 479 );
			this.AddAlphaRegion( 207, 11, 241, 479 );

			if ( pm_from.Female != true && pm_from.Race == Race.Human ) {  this.AddImage(16, -28, 12); }
			if ( pm_from.Female != false && pm_from.Race == Race.Human ) {  this.AddImage(16, -28, 13); }
			if ( pm_from.Female != true && pm_from.Race == Race.Elf ) {  this.AddImage(16, -28, 14); }
			if ( pm_from.Female != false && pm_from.Race == Race.Elf ) {  this.AddImage(16, -28, 15); }
			if ( pm_from.Female != true && pm_from.Race == Race.Gargoyle ) {  this.AddImage(16, -30, 666); }
			if ( pm_from.Female != false && pm_from.Race == Race.Gargoyle ) {  this.AddImage(16, -30, 665); }
                                                        this.AddImage(16, -28, 50970, 1308);

			this.AddLabel(41, 224, 1193, "- Character Stats -" );
                                                        this.AddItem(17, 209, 8397);
                                                        this.AddItem(169, 209, 8398);
			this.AddLabel(360, 470, 1193, "<) S.F UO (>" );

			this.AddLabel(68, 199, 2499, myname );
			this.AddLabel(31, 257, 2033, "Strength" );
			this.AddLabel(31, 273, 2033, "Dexterity" );
			this.AddLabel(31, 289, 2033, "Intelligence" );
			this.AddLabel(31, 312, 2033, "Hit Points" );
			this.AddLabel(31, 328, 2033, "Stamina" );
			this.AddLabel(31, 344, 2033, "Mana" );

			this.AddLabel(63, 366, 2033, "Fame");
                			this.AddLabel(63, 384, 2033, "Karma");

			this.AddLabel(16, 404, 336, "Game Time");
			this.AddLabel(16, 420, 336, "This Session");

			this.AddLabel(262, 13, 1193, "- Equipment Bonus -" );
                                                        this.AddItem(383, 18, 7942);
                                                        this.AddItem(221, 12, 5145);
                                                        this.AddItem(392, 15, 7943);
                                                        this.AddItem(383, 24, 7945);

                			this.AddLabel(231, 43, 2033, "Hit Point Regen");
                			this.AddLabel(231, 63, 2033, "Stamina Regen");
                			this.AddLabel(231, 83, 2033, "Mana Regen");

                			this.AddLabel(231, 113, 2033, "Hit Chance Increase");
                			this.AddLabel(231, 133, 2033, "Defence Chance Increase");

                			this.AddLabel(231, 163, 2033, "Faster Casting");
                			this.AddLabel(231, 183, 2033, "Faster Cast Recovery");

                			this.AddLabel(231, 213, 2033, "Lower Mana Cost");
                			this.AddLabel(231, 233, 2033, "Lower Reg Cost");
               			this.AddLabel(231, 253, 2033, "Spell Damage Increase");

                			this.AddLabel(231, 283, 2033, "Damage Increase");
                			this.AddLabel(231, 303, 2033, "Swing Speed Increase");

                			this.AddLabel(231, 333, 2033, "Reflect Physical");
                			this.AddLabel(231, 353, 2033, "Enhance Potions");

                			this.AddLabel(231, 383, 2033, "Luck");

                			this.AddLabel(231, 413, 2033, "Bandage Speed");
                			this.AddLabel(231, 433, 2033, "Swing Speed");

                                                        this.AddItem(15, 452, 4155);
                                                        this.AddItem(11, 471, 4095);

                                                        if ( myhunger <= 1 ) { this.AddLabel(53, 449, 1193, "You are Starving!"); }
                                                        if ( myhunger > 1 && myhunger <= 5 ) { this.AddLabel(53, 449, 2033, "You are extremely hungry"); }
                                                        if ( myhunger > 5 && myhunger <= 10 ) { this.AddLabel(53, 449, 2033, "You feel Ravenous"); }
                                                        if ( myhunger > 10 && myhunger <= 12 ) { this.AddLabel(53, 449, 2033, "You feel a bit Peckish"); }
                                                        if ( myhunger > 12 && myhunger <= 15 ) { this.AddLabel(53, 449, 2033, "You feel Full up"); }
                                                        if ( myhunger > 15  ) { this.AddLabel(53, 449, 2033, "You are Stuffed!"); }

                                                        if ( mythirst <= 1 ) { this.AddLabel(53, 465, 1193, "You are very Dehydrated!"); }
                                                        if ( mythirst > 1 && mythirst <= 5 ) { this.AddLabel(53, 465, 2033, "You are extremely thirsty"); }
                                                        if ( mythirst > 5 && mythirst <= 10 ) { this.AddLabel(53, 465, 2033, "You're feeling very Dry"); }
                                                        if ( mythirst > 10 && mythirst <= 12 ) { this.AddLabel(53, 465, 2033, "You are a bit thirsty"); }
                                                        if ( mythirst > 12 && mythirst <= 15 ) { this.AddLabel(53, 465, 2033, "You feel fine"); }
                                                        if ( mythirst > 15 ) { this.AddLabel(53, 465, 2033, "You have drunk plenty"); }

                			Account xx = ((Mobile)pm_from).Account as Account;
                
                    		this.AddLabel(112, 257, 2033, ":  " + mystr.ToString() );
                    		this.AddLabel(158, 257, 2033, "(+" + mybonusstr.ToString() + ")" );
                    		this.AddLabel(112, 273, 2033, ":  " + mydex.ToString() );
                    		this.AddLabel(158, 273, 2033, "(+" + mybonusdex.ToString() + ")" );
                    		this.AddLabel(112, 289, 2033, ":  " + myint.ToString() );
                    		this.AddLabel(158, 289, 2033, "(+" + mybonusint.ToString() + ")" );

                    		this.AddLabel(118, 312, 2033, ":  " + myhits.ToString() );
                                                        this.AddLabel(158, 312, 2033, "(+" + mybonushits.ToString() + ")" );
                    		this.AddLabel(118, 328, 2033, ":  " + mystam.ToString() );
                                                        this.AddLabel(158, 328, 2033, "(+" + mybonusstam.ToString() + ")" );
                    		this.AddLabel(118, 344, 2033, ":  " + mymana.ToString() );
                                                        this.AddLabel(158, 344, 2033, "(+" + mybonusmana.ToString() + ")" );

                    		this.AddLabel(105, 366, 2033, ": " + myfame.ToString());
                    		this.AddLabel(105, 384, 2033, ": " + mykarma.ToString());


			this.AddLabel(95, 404, 2033, "  " + mytimedays.ToString() + "d  ~" + mytime.ToString() + " : " + mytimemins.ToString() );
			this.AddLabel(95, 420, 2033, "  " + curr );   

			this.AddLabel(390, 43, 2033, ":  " + myregenhit.ToString());
     			this.AddLabel(390, 63, 2033, ":  " + myregenstam.ToString());
    			this.AddLabel(390, 83, 2033, ":  " + myregenmana.ToString());

                   		this.AddLabel(390, 113, 2033, ":  " + myattack.ToString());
                    		this.AddLabel(390, 133, 2033, ":  " + mydefend.ToString());

                   		this.AddLabel(390, 163, 2033, ":  " + mycastspeed.ToString());
                    		this.AddLabel(390, 183, 2033, ":  " + mycastrecovery.ToString());

                    		this.AddLabel(390, 213, 2033, ":  " + mylmc.ToString());
                   		this.AddLabel(390, 233, 2033, ":  " + mylrc.ToString());
    		                  this.AddLabel(390, 253, 2033, ":  " + myspelldamage.ToString());

		                  this.AddLabel(390, 283, 2033, ":  " + DamageIncrease.ToString());
		                  this.AddLabel(390, 303, 2033, ":  " + myweaponspeed.ToString());

                  			this.AddLabel(390, 333, 2033, ":  " + myreflect.ToString());
                  			this.AddLabel(390, 353, 2033, ":  " + myenhancepotion.ToString());

                  			this.AddLabel(390, 383, 2033, ":  " + myluck.ToString());

                  			this.AddLabel(390, 413, 2033, ":  " + String.Format("{0:0.0}s", new DateTime(TimeSpan.FromSeconds( BandageSpeed ).Ticks).ToString("s.ff") ) );
                  			this.AddLabel(390, 433, 2033, ":  " + String.Format("{0}s", new DateTime(SwingSpeed.Ticks).ToString("s.ff") ) );

		}
	}
}